package com.bootdo.hotel.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.hotel.dao.HotelEveryDayMoneyDao;
import com.bootdo.hotel.domain.HotelEveryDayMoney;
import com.bootdo.hotel.service.HotelEveryDayMoneyService;



@Service
public class HotelEveryDayMoneyServiceImpl implements HotelEveryDayMoneyService {
	@Autowired
	private HotelEveryDayMoneyDao hotelEveryDayMoneyDao;
	
	@Override
	public HotelEveryDayMoney get(Long id){
		return hotelEveryDayMoneyDao.get(id);
	}

	@Override
	public HotelEveryDayMoney getByCodeIdAndDate(Long codeId, String day) {
		return hotelEveryDayMoneyDao.getByCodeIdAndDate(codeId, day);
	}

	@Override
	public HotelEveryDayMoney getMinMoneyByHotelId(Long hotelId, Long roomTypeId) {
		return hotelEveryDayMoneyDao.getMinMoneyByHotelId(hotelId,roomTypeId);
	}

	@Override
	public List<HotelEveryDayMoney> list(Map<String, Object> map){
		return hotelEveryDayMoneyDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return hotelEveryDayMoneyDao.count(map);
	}
	
	@Override
	public int save(HotelEveryDayMoney hotelEveryDayMoney){
	
		if(hotelEveryDayMoney.getId() != null) {
			return hotelEveryDayMoneyDao.update(hotelEveryDayMoney);
		}else {
			return hotelEveryDayMoneyDao.save(hotelEveryDayMoney);
		}		
	
		
	}
	
	@Override
	public int update(HotelEveryDayMoney hotelEveryDayMoney){
		return hotelEveryDayMoneyDao.update(hotelEveryDayMoney);
	}
	
	@Override
	public int remove(Long id){
		return hotelEveryDayMoneyDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return hotelEveryDayMoneyDao.batchRemove(ids);
	}
	
}
